
%
% mice example from WinBUGS
%

dataStruct = struct( ...
    't', [ ...
	12, 1,  21, 25, 11, 26, 27, 30, 13, 12, ...
       	21, 20, 23, 25, 23, 29, 35, nan, 31, 36; ...
	32, nan, 23, 12, 18, nan, nan, 38, 29, 30, ...
       	nan, 32, nan, nan, nan, nan, 25, 30, 37, 27; ...
	22, 26, nan, 28, 19, 15, 12, 35, 35, 10, ...
	22, 18, nan, 12, nan, nan, 31, 24, 37, 29; ...
	27, 18, 22, 13, 18, 29, 28, nan, 16, 22, ...
       	26, 19, nan, nan, 17, 28, 26, 12, 17, 26 ], ...
    't_cen', [ ...
	0,  0,  0,  0,  0,  0,  0,  0,  0,  0, ...
       	  0,  0,  0,  0,  0,  0,  0,  40, 0,  0; ...
	0,  0,  0,  0,  0,  40, 40, 0,  0,  0, ...
       	  40, 0,  40, 40, 40, 40, 0,  0,  0,  0; ...
	0,  0,  10, 0,  0,  0,  0,  0,  0,  0, ...
       	  0,  0,  24, 0,  40, 40, 0,  0,  0,  0; ...
	0,  0,  0,  0,  0,  0,  0,  20, 0,  0, ...
       	  0,  0,  29, 10, 0,  0,  0,  0,  0,  0], ...
    'M', 4, 'N', 20 );

init0 = struct( 'beta', [0, 0, 0, 0], 'r', 3 );

[samples, stats, structArray] = matbugs(dataStruct, ...
		fullfile(pwd, 'mice_model.txt'), ...
		'init', init0, ...
		'nChains', 1, ...
		'view', 1, 'nburnin', 1000, 'nsamples', 500, ...
		'thin', 10, 'DICstatus', 1, ...
                'monitorParams', {'mu', 'beta', 'median', 'r'}, ...
		'Bugdir', 'C:/Program Files/WinBUGS14');

stats.mean
stats.DIC.total



